#include <sys/stat.h>

void * _sbrk_r(struct _reent *_s_r, ptrdiff_t nbytes);

extern char end[];
static char *heap_ptr;

void * _sbrk_r(struct _reent *_s_r, ptrdiff_t nbytes)
{
    char *base;
    if (!heap_ptr)
    {
        heap_ptr = end;
    }
    base = heap_ptr;
    heap_ptr += nbytes;
    return base;
}


